Improve arrayAssign, update tests