Correcetd a minor bug that affects array in margins; use perl=T