Simplfied the code updating commands so they are correctly updated in all cases.