Do you want to test ``shelltype`` here? If ``havecontain`` is false, then probably we shouldn't touch the ``contain`` substructure, or?

There are several of these further down in the pull request.