Merge "Remove redundant code to check container type." into nyc-dev