(0.9.37-unstable) Backport over changes to cpu.cpp