Fix return type reference problem when return type is primitive or string