Fixes for android

minimal changes to make it work with android ndk