Make sure write of an empty MessageList does not throw an IndexOutOfBoundException