Fixing issues with logging system