Some fixes to the crystal path lookup algorithm