Fixed build warnings and errors on linux