ref #93: fix session crash during binary processing

now there's both the optimisation and also the script not crashing, which is nice