fixed some bugs

ok now the command should generate correct output. i recommend a total refactoring of this command btw ;)
Merge pull request #18 from digitalkaoz/patch-1

fixed some bugs