Updated var_int to do conversion on serialisation