Fixed major bugs with scheduling and sending messages.