Bug fixes from windows env