Various fixes to misoperation.