Fix an issue with the `getblocks` command not replying
Fix a failing assertion, a stack overflow and group `inv` frames together