small fix and clarifying code and log messages