Fixing debug output for certain events