Database class fixes