Fix some compile bugs