Fixed miscellaneous bugs in converting annotations to strings and optimized
parentheses in the string representation.