fix MCMF's cost bugs