Implemented a debug log output
Added more error handling for USB style errors