Bugfixing + update logging