Application will now automatically exit when the last window is closed.