Fix task queries (WIP)