pilot 4: logger and some bugfixes.