Added thread control and mailbox improvements.