Fix nested brackets