Improved tests and added support for window selector.