Better error handling to parseReply function - if unable to parse, still returns rather than hangs.