Fixed error in registerMock function