Code: Refactored WriteFile method.
Test: Change settings default host.
Merge pull request #398 from am11/master

Misc fixes