Fixes issues for android API < 12
As well as minor changes