Changes to make the preview script also run on Darwin