fixed writing error and overlooked command arg
Merge pull request #52 from dali99/master

fixed writing error and overlooked command argument