Added bugfixes and improvements for the task module