Various fixes

Hi,

thanks for all your effort in this driver.

I used it a little bit recently and I had to fix some issues.

Thanks!