Henry and Ahmed's fixes to lsupdate and database