Remove unused code
Coerce buf id to int in various places. This is probably a bug in the server.
This is already logged in python-land