variable name fix: mod  => module (both version existed for the same variable)

Signed-off-by: Mattias Andrée <maandree@operamail.com>
more curly brackets, I love them

Signed-off-by: Mattias Andrée <maandree@operamail.com>
utilitise bash's to lower case convertion

Signed-off-by: Mattias Andrée <maandree@operamail.com>