Tested and corrected some bugs, mostly with db_catchup