Various fixes for tests not working on android