fixed Mac OSX compatibility
fixed Windows compatibility
fixed another Windows compatibility problem