partial fix for bug #169

Costs should be double, int int.