Fixing mismatched brackets