Fixed some code review issues from Yiming.