Fixing man-in-the-middle script to work with new protocol.