Bugfix and improved logs
Tidy