Merge "spmi: Correct pointer casting and arithmetic"