[FIX] When no pending messages was giving -1 instead of 0.

When there was no pending messages, the pending method was answering -1. It should be 0. I don't see a reason for the modifier (-1) when offset is greater than 0.