build: fixes to cross referencing and over generation issues