Suggested changes made.

Fixes to eliminate duplicate code, and handle appropriate
parenthesizing and deparenthesizing.