Fix build and warnings on linux