Bug Fix: array syntax and factor together in regressions

Also added corresponding examples