Fix exception when editing sessions