Fixed more bugs in the window constructor functions