fix idiotic array handling, change the way chmod mode is handled