Fix problem with "null" message when unloading under IE11

Fixes #457