Fixed various regressions introduced by modularization