Added backwards functionality and graceful handling of an empty/nil attributes array.