Added check for socket erroring (prevents crash)
Added check to prevent sending the same cell twice
Consistent indentation!
Consistency!
Merge pull request #2 from jsoxford/some-fixes

Some fixes