Associative arrays does not work on Bash 3 (OS X for instance). Change to ordinary variables to be more compatible.