Fix build for windows, add support for vista and 7