Two fixes to make it work in more places

Well one of those was the hardest bug caused by one character I've ever attempted to diagnosed.  It sometimes fails and sometimes doesn't because of the 5.18 hash randomisation.

THere's another test failure on our platform but I may get to that tomorrow.