Fixed some regressions introduced with recent refactorings