manually undid much of pull #287. Discussion in #398