Fixing some issues with logging