Fixed memory management in styles