some fixes for test failures on various platforms