Android compatibility fixes