fixes from Brian Dorsey's code review.