Fix UnicodeDecodeError when creating new tasks.

Fixes #392.