Cleanup of typos in code examples

Tiny cleanup to the file reading/writing code snippets.