Fix for errors associated with stopping on closecurly at the end of file where two are expected