Fix bug: dont check array.empty() before reset()