Fix some warnings and compilation errors with gcc 4.8

Signed-off-by: LaboDJ <jacopolabardi@gmail.com>