add -Wall and fix a bunch of warnings