Changes from Philip's code review.