Remove cast toArray

See #248