bugs fixed in db upgrade system