Fix crash when passing messages to running instance from commandline