Add array().allowSingle()

Fixes #474 and #498.