fixed code so that it can be built under Windows