Database setup fixes