ENH: Optimize array creation by avoiding errors