Fix a bug in exporting trait implementations

I used the wrong condition where I was looking for "is this method public or is
this implementation a trait" rather than what was being checked.