Fix comments in the end of nested blocks messing up semicolon generation by removing comments in nested blocks