Fixed compile errors and warnings on Linux