Use quit-window instead of maintaining a stack of window configurations.