fix for issue #365
Merge pull request #377 from martinpovolny/cost-strategy-fix

fix for issue #365