Fix several bugs reported by scrutinizer
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop