Merge pull request #11 from vrz/master

fix some bugs, warning prevention