Fixed parsing errors with deep nested states