fix TTL code, changes for MEG (matlab2009)