Fixed bugs in infilling of sites, added debug mode.