Made some fixes to cpu version for demo