Added improvements to the thread-application communication.