A few Java and Android fixes