fixing some problems with names resolution