Bugfixed logging