windows support + some bugfixes