Fix detection of set/list for fetch