some rudimentary error handling, seems to improve things - at least it doesn't swap channels any more. Still the odd tiny glitch though.