Correctly check return value of send.