Path calculation fix