Remove warnings

Using more idiomatic C++ in some cases