catch empty sub-term list when pattern matching (closes #3150)