Fixed bug in aStar