Bug fixes

Various fixes to trace back errors
I don't see how else this can be done, since the input mode can only be changed before reading data, which can't be done if an external digitizer is being used