Fix for cancelling usb transfers. Also make sure to crear the endpoint after receiving a cancel event.
Removed casting in some function arguments.