Fix comparing file scopes2

Squashed #375