Fixed compatibility with using default_scope.