Some small bugfixes (mostly warnings) and little improvements to the log