Fixed on Windows + some other bugfixes