Fixed bugs introduced by "loose coupling" refactoring