Fix handling of exitcode, name of "payload" key, add stub for shutdown.