fixed small bugs so compiles on windows