Added comprehensive check for corrupted data received from server to fix occasional stack trace from defunct server causing data corruption.