Amended database.py to make it run (hopefully).