Fixed undefined variable error.
CS fix.
Merge pull request #1 from uzyn/bugfix/encode

Fixed undefined variable error.