Fixed bug in __encode()
Merge pull request #4 from wooters/master

Fixed problem with working example