Add missing coverage for tasks and fix a bug.
finish coverage for identity.tasks