orders at the same limit should be filled in the order of their timestamp, oldest first.
if the older order is filled completely and the younger order meets another, older order, the limit of the oldest order at the next best price will be the next execition price (etc etc).
Say you post a bid with a 10 EUR limit, no asks. Nothing happens during the execution.
Someone else posts a bid @ 9.9 EUR, nothing happens since no matching orders are found during the execution.
Someone comes along and posts an ask with a 9.5 EUR limit, that's the order that's being executed, it first executes against the first bid, the trade is settled at 10 EUR/BTC, if it isn't filled it will continue execution against the other order at 9.9 EUR/BTC.
Now if it's still not filled it remains by itself in the order book.
Now say someone posts a bid with a 11 EUR/BTC limit price, then it will execute at 9.5 EUR/BTC against the only remaining ask in the order book.
If multiple orders are at the same price, the older ones get filled first.
If it doesn't work that way then it is a bug.
however: if the limit of an existing order is changed or the size of the order is increased, it gets a new timestamp.
The code that is responsible for automatically testing it, and preventing regressions is 924 LOC long.
The code to test ratio is almost 3. Care was taken. And better, anyone can go check it out independently on github.
Hope that answers your questions