Found and fixed null pointer bug

I forgot that regenerateLookup() is used for init too. Oops.