Finally fixed what I hope is the last of the urlencoding problems