Fix bugs found during review.