fixes

Hi Adam,
I've cancelled the previous changes and made separate branches with the proposed changes.
This devel branch only contains the fixes.
There is another branch for_libnfc_170 to prepare changes to support next libnfc release, if you want to use it it's probably better to do it also in a separate branch till the libnfc 1.7.0 is released.
Cheers
Phil