fix permil_done as int