Changes in response to code review from @kcooney.