Fixed "unsaved changes" message

Fixes #1400

Please review @tomneedham @karlitschek @butonic