Break infinite loop while resolving aliases