Android cpp bug fixes