Bugfix: Correct was_minimized flag transition