F/merge proto

pending_proto can be NULL and that can also trigger a replace operation. so in fact the boolean was there for a reason, even though a comment would have been useful.