Added conditions for allowing brace matching.