Removed cruft.
More neater.
This should fix empty messages.
Fixed some warnings.
Nick change working properly with threads.