Fixed c++ class instantion