Bug Fixes to the portal layout injector