fix two obscure bugs in OnlineReg
Merge branch 'master' into develop