Various to try and strengthen the code against Marionette issue 859439.