A* and some bug fixes

Autograder approved