fix #377 , added extra type checks and fixed conversion order
fix #377 , added extra type checks and fixed conversion order

toni-moreno/snmpcollector,toni-moreno/snmpcollector,toni-moreno/snmpcollector,toni-moreno/snmpcollector,toni-moreno/snmpcollector