Some bugfixes . Commiting to build on windows .