Respect flags when fetching class by name