Fix issue with global-scoped types in declarations