Fix error in scm-analysis.R when data frames empty