Incorporate pwendell's code review suggestions.