fixes #544, windowIds can now handle initial value of -1 or 0