fix bugs introduced by elsewhere refactor #1369