fixes to update_codes