[BUGFIX] RTE: Determine window object correctly