Added support for reading int32 values and reading/writing int64 values. Fixed some size miscalculations.