Fixed a crucial bug in update.py that did not close database, and thus resulted in changes not being saved