Improved excpetion message while trying to access an attribute from an empty array.