Fix host.name access error when it isn't present in the database