Fix end-keyword stack level error