Fix missing log import.
Allow more flexible host component (e.g. with username).
Improve error message for a missing profile.