Fixed confirm discard changes modal issues

Fixed confirm modal throwing exceptions in certain cases (Sections).Fixed confirm modal not properly discarding changed data.