Tidying up of model fit script.