Fix bugs based on code review comments.