minor cleanups in database.py