Fixed some compile bugs