Format numerical output better, and do more comprehensive testing