FEAT: a bit more accurate error messages for unmatched ] or ). Related to tickets #606 and #608.