Some fixes to build

Many thanks to NamelessRom, ArchiDroid, Omnirom