Added timeout of unit test, fixed bug with double setting exception on task.