Fix exit where variable number of category ranges