Fix mocking of internal classes