array_tools.sh: Fix functions