Small bug fixes and rework of API.

This is current series of patch from linux-usb mailing list. This series depends on all previous series so please merge them first and then this will be only 5 commits.

Description from linux-usb: