Fixed array creation bug on Nashorn

Nashorn doesn't like the way the parent variable is coerced to an array. Fixed by calling the Array constructor.