Fix tests to work on wider variety of systems