Handle references to top-level modules properly.