Merge "Guard against failed array allocation" into nyc-dev