Merge branch 'coverity' into 'master'

Simplifications identified with the help of Coverity

See merge request !38
2 jobs for master in 67 minutes and 42 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #4900
amd64
job_clang_amd64

01:07:41

passed #4899
amd64
job_gcc_amd64

00:52:29