Fixed small bug in database.py