tweaks to fix cygwin compilation
removed unused headers
merge