Fixed small bug in Database