Fixed possible crash while receiving data.