Fix some dumb errors/poor C++