add stdlib for free()
Check if transports work

If the transport breaks then raise an exception. Currently the
exception in main and nothing is done. I'm not entirely what needs to
be done.