small changes to allow support for custom costs in PathBiDirRef