added safeguards so host without ending slash does not crash things
Merge pull request #59 from jimhansson/safer-host-variable

added safeguards so host without ending slash does not crash things