Some code fixes after peer code review.