Minor modifications for OSX and type convertion