fix nan warning in cellid (updated from broken merge)