Fix edge cases in "Duplicate class found..."

ex.
class A {
  class C {
    class A {
    }
  }
}