Corrections to the profile updating code