Fixes to allow GCC4.7 building