Fixing some platform issues - was blindly cutting & pasting scripts that had some platform-specific hacks