Fix incorrect cost when quantity changes