patches for unit test portability