minor c++ bug