Incorporate code review feedback from @yihui