Merge in minor changes from pull request.  Clean up code.