Move output of model ids to after the model id has been checked for nil.