small fixes to logic, log output