fixed type compatibility warning in main, added some error handling
Merge branch 'dev' of github.com:Dragerus/lmp7 into dev