fixes to get spike recording to work correctly.

multiude of bugs. to which way much effort to explain here.
STABLE FOR SPIKE RECORDING