FIxed settings dialog closing.

Invalid elements prevent application, but not cancelling.