Build fixes and Android improvements