Fix byte order / cast bug in ipc command handler.