Patch by Markus Heidelberg. ${VAR//-/_} which replaces - with _ aborts with "syntax error" on a system where /bin/sh points to dash. Use tr therefor as already done in the line above rather than changing the shebang to bash.
'default n' is the default, so there's no need to say it explicitly.