Fixed a bug where bracket-matching was failing in some instances of sentences which still had unresolved #RANDOM[] and #REPEAT[] elements.