The diagnosis and cure of garden paths