core: Fix fetching, use UIDs