Clean up pull request.
Apply pull request changes to selfupdate script.
Code style tweaks in install and selfupdate scripts.