Some bug fixes to IPC