Fixed error in getFilteredClaimedTasks procedure. Fixes #978