Used local -a for all local variable that are arrays

This provides better compatibility with older bash versions, in my case 2.05b