Fixed issues with acquiring windows, and a null pointer error when clicking on no window at all.