Fix array clearing