Properly format binary tokens on errors, closes #2144