Adding check to scanner so nested custom tags of same type generate proper code. Adding edge case to test