Fix 4 issues

This PR covers all OS X Mavericks issues that I've recently discovered in my testing on a clean Mavericks install. (And reinstall to test idempotence.)

Here's an install log for the [first install on a clean Mavericks](https://gist.github.com/gohanlon/d0e694667ad5e15cfba1) and a the [second install](https://gist.github.com/gohanlon/2cf6a178831c54e2d484) to show idempotence.
Yup, I couldn't quickly figure out how to parse that with cut(1). I feel like there's a way to merge head(1) and awk(1) --- `| awk 'NR == 1 { gsub(/,/, ""); print $3 }'` maybe --- but this is fine as-is.