fix for excluded modules being included in optimized files

Fix for optimized files including dependency information for excluded mo