Fix /?# in random string, fix http error handling