Speculative fix for the errors with free buildings granted by traits.

I think this will work to fix issues with free buildings from traits.