Database bugfix