Various fixes to compile with GCC 4.7

Signed-off-by: kecinzer <kecinzer@gmail.com>