fix bugs in impl of #762