Fixed c++ bug.