Buffer.cs: Added count for messages within the buffer.
                 Added a few more contract conditions.