Fixes fileWriteError param reference.

Also updates all "e" vars to "err" for consistency.