functions.sh: fix mistake in loop variable