Fix a bug when self.id isn't a number or is NaN