The way the PIC code works is that it has a current state and a last state: it sends changes between the two. It takes several milliseconds to send a button press/release code, and so if there's bounce inbetween it still maintains a consistent last/current state and sends the delta.

I'm confident that if a button is released (electrically) then the PIC will send the right code. The greyer areas are faulty switches and the code not being recognised for a variety of reasons at the main CPU end.

Hugo