Add guards around potential non-existing property access in debug statements.