Fixed a bug where script would crash if server responded badly.