Better type checking for Arrays