Fix for issue #223. Handle situation where windows is nil.