fixed Ref parsing in custom types