Fixing NPEs because IDs are not known yet.