* unify error handling
* V2: attribute version must be 2; tag errors must exist
Merge pull request #279 from guwirth/refactor/cppcheck

cppcheck refactoring