Fixed a bug in short paths