Misc fixes

* Refactored WriteFile method. 
* Change settings default host.