Small bug fix.

* Fixed code for when it values are to big to exponentiate.
* Agent can now restrict it's samples so terrain always has the lowest
cost.
* Fixed formatting