Fixes for OSX script