Further fixes for tests that stubbed or mocked where(...).first.