Fix some bugs and do some refactor
Merge branch 'master' of https://github.com/Themis-J/Themis
Merge pull request #3 from darwink/master

Fix some bugs and do some refactor