fixed various bugs in db1.py and dbcal.py