fix some bug of A*, but still there's a lot of bugs remain.