Fixed some c++ errors