Correct a bug in get_correct_jobname(). If there were multiple '.' characters in a hostname it would get confused, even with nothing set. This is now fixed and unit tested.