Fixed some compile bugs caused by double declarations.