Fix some issues from code review