Fixed bug where sent scheduled messages were still being ordered based on the due date not the sent date. Made some more tests configuration independant. Issue: #731