Code Review Feedback

Fixed some handling of errors and invalid hosts