Added support for attr_cast