Fixes to make testsuite match better across platforms

Eliminates spurious test failures on some platforms because of minor math differences or the way values are printed.