Fix some errors detected by coverity.
Fix warnings from merged code.
Fix warnings from merged code.
Make the work of a static analyzer a lot easier.

Most static analyzers don't understand that a M_FATAL message means
things will generate a NULL pointer dereference and blow up the daemon
and that M_ERROR_TERM leads to the program doing an exit(1)