Improved class attribute handling.