improve error handling on array subsets