Fix a keyerror when non nins are defined