Improved resolving and completion of global variables.