Handle namespace collision warnings

This handles namespace conflicts warning when you use a class that conflicts with different class names the namespace hierarchy.

@ke-yu @aparajit-pratap 

Well probably continue traversing the left (null) node is not a good idea. We either put comment here to indicate it is safe to do that, or directly return here, otherwise we have to go back to the beginning of this function to see if it handles null value properly. 

Same for the second condition.