Make sure the right side of a paren exists before checking its ID.

Closes GH-900.