Fixing tooltip content rendering function