Small database fixes