Move attributes init to the right place.