minor improvements to path finding