Fixed issues according to code review.