Warning free build

Here is some fixes (most trivial) which allow a warning free build, even with -Wall and recent gcc (tried with 4.7.2).

Please check 82bebd4