Small fixes to tasks.py