Fix module install path in template
Check of $1 for workdir should only happen after arguments were parsed (e.g. $1 is the *remaining* argument)

* Check of $1 for workdir should only happen after arguments
  were parsed (e.g. $1 is the *remaining* argument)
* Fix modules install path