Various small fix

We especially provide improvements for both #237 and #323. Other commits are here for documentation and to fix some violations reported by sonar. A note about sonar: we're adding violations again and again but:
- They're rarely serious
- The global code quality is stable, meaning that most of the code we add is clean