Fix for bug #1638, where a non-string data could break an Ajax request.