Issue #612: fix propagation broken by refactoring + slightly better algorithm