Fix brackets matching