Made fixes to better support Android