build fixes for android and mac os x