Fix run_cost() for diagonal moves.

Probably fixes #1552.

Now uses float in stead of int for calculations.