Minor improvements and a windows fix