Fix a small bug in peer_handler