Warning fixes (GCC)

This fixes most of the trivial warnings from GCC.