Correctly read/write strings

Signed-off-by: Chris Sanders <zidane@outlook.com>