Fixed stubbing errors in tests introduced by refactoring.