Merge pull request #331 from untitaker/sprint-branch

:>
Fixed to adapt to new signature of to_bytes