bugfix + --template

New pull request in its own branch with updated documentation