Fix compile errors with GCC 4.7.2
Merge branch 'topic/gcc47_fixes'