You get a 'Could not close nest' error if you leave a [`] or [//] comment at the end of a closing branch statement.
The issue was found by accident due to a typo, but it can take a while to find the cause of the error in a large project; since the error line is the last line of the project, even though the problem is elsewhere.
The following 3 snippets throw up the error:
`
If 1 < 2
Print "Result is true" : Wait Key
EndIf`
`
If 1 < 2
Print "Result is true" : Wait Key
EndIf//
`
While 1 < 2
Print "Result is true" : Wait Key
EndWhile//
This one will not cause an error because the comment is not empty
If 1 < 2
Print "Result is true" : Wait Key
EndIf` Hey
This last one will not cause an error because there is a space between the statement
If 1 < 2
Print "Result is true" : Wait Key
EndIf `