Logmode, many a bug fix