Fixed the cost formula (again).