Fixed confirm discard changes modal issues

Fixed the confirm modal throwing exceptions in certain cases (like
Sections).
Fixed the confirm modal not properly reseting data on discard.
Merge pull request #344 from reciprocity/feature/fix_confirm_modal

Fixed confirm discard changes modal issues