Database fixes