Merge "Fix some issues caught via a static analyzer" into nyc-support-25.2-dev