Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit also fixes of other potential issues and improves logging.