Database fixes for Android