Improved error messages in ArrayScope.