Make the units setting work and clean up a little.