Fixed NullPointerException when closing connection while data is being sent.
Added timestamps to messages.