Wrong calculation and missing string in log message