Fixed a bug where characters were not being percent-encoded