Improve error messaging to identify containing type.