[FIX] Fixes several errors after refactorization.