Fix exception when retrieving previous values on edit