log plotting and bugfixes