Bugfixing for windows API (primarily switch_to_window and within_window)