Added some tests for Task commands

I also fixed some failures discovered by the tests.