Merged reading & writing structs tests together, and fixed a bug.