Make handling of config more robust

- Make sure hosts parameter is interpreted correctly
- always allow the use of alias