Shored up hostname support and added test cases