fixed g=0 issue; search for solutions from vhat

There was a numerical issue with checking solutions when g=0. Now it
checks for that as a special case. Also, when solving at the root, it
now searches for a solution in order of distance from vhat, stopping
once it gets one. Finally, added a new case. Doesn't work yet.