Windows bugfixes + debugging