Fix fatal bug: strcmp of window type