Fixed cleaning and Windows implementation