Fixed all the compile errors/warnings. BTW, use -Werror. It's good.