Re-added support for type_cast parameter.