Fix lurking bug, finish rearchitecturing