Fixed warnings and compiler errors on linux