Simplify and fix some issues with snmptrap handler