Improve `PeerHandler` debug_assertions and checks