Fix parsing and formatting of sign expressions