Fix issues in tasks.py.