Merged some MP fixes to cmd code for SP.