Improve detection of container via begin()