Fixed issues found by code review.