p2p: fix issues found during review