Correct use of logger. Fix #728