Fix testsuite bugs

Testsuite now works on Linux and Mac