Brace matching improvements