cherry-picked the compiler warning clean-up from another branch