Further changes due to code review from @kcooney.