Minor database fixes