(0.9.37-unstable) Backport changes to spu.cpp