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