Bug fix: removing cached curve cost when modifying the functional.
Fixed issues with A* and non-symmetric connectivity.