Improved Route.getHost implementation

Addresses #323 and #177.