Fixed behaviour of "Clear on Exit" with "Exit Confirmation"

-> refactored that part of code too