Fixed warnings, and removed code that relies on newer c++ standards