Setup: various minor tweaks

I've done a few very minor tweaks to setup, mainly to make it more portable. See the commit logs for exact details.