included comments, corrected parameter check

The parameter length is checked correctly.
Comments are also reused and generated, downside: they must exist.
Merge pull request #1 from dkk/master

included comments, corrected parameter check