Read int, read long, write long fixes

only unsigned long works so far, need to implement custom longish
types, read int32 implemented, read ulong implemented.
a