Restored working behavior and removed compilation errors, after database
refactoring.