Fix return type reference problem when return type is primitive