fix two obscure bugs in OnlineReg
Bug fixes