Fixes fileWriteError param reference.

Also updates all "e" vars to "err" for consistency.
Merge pull request #1 from staydecent/master

Fixes fileWriteError param reference error