Fix potential overflow and dividing by zero
Merge pull request #580 from dalkon/master

Update to 10.35
Code cleanup
Add missing flag and remove duplicate

Thanks to @andypsylon for pointing it out
Fix Travis build error
Fix Travis build error
Fix typo
Fix last build errors