Followup to @orta and @robb's code review.

See commit descriptions.