Adding some logging and correcting protocol lookup