Fix some compile bugs from merge