Changes from code review with @ggilder