Adapted for the latest changes to model initialization.