Fixes #1313 - identifiers lost when starting with WITH
Merge pull request #1360 from systay/1313

Fixes #1313 - identifiers lost when starting with WITH