Moved building of _SPEC_LOOKUP. Hopefully this is clearer.