bug fixing and cleanup to branch for android