Fixed bug where A* would move away from exit instead, and also out-of-bounds