Fix for case where attributes is NULL