partial fix for bug #169

Costs should be double, int int.
Merge pull request #170 from linas/cost

partial fix for bug #169