fix multiple issues in viewhistory logic, ref #135