Fix ensure_inclusion_of to support plain attributes

This fixes #492.

Also add missing tests to confirm this behavior.