Added condition to checkj if task can be deleted. Bugfix. New behat tests