Incorporate a few improvements made for other projects back into ManUp

I take no credit/blame for the code in this pull request.