Fixed several bugs in the android toolchain