Add specs for cross-window operation; fix issues discovered through tests