fix windows support, add support for OS X