Fix exception if _sendData is called with data == nil

This should fix issue #54.