Fixed several warnings and errors when compiling on Linux.