fixed handling of optional class attributes