Changed: Logfiles are now written as soon as possible (allows to mitigate memory consumption)
Small fixes + cleanup