Changed the style of the type checking, using the Class attribute instead of Type.