Fixed an error in naive.