Fixes error encountered when mocking ref methods