Fixed total_cost difference in decoder