Fixed bug when a null window was specified.