Implementation changed due to issues under windows 7.