Sales and profits improve after a brutal 2016.