fixed an issue in 'each' method of sparse vector