Revert "gcc 4.8 fixes"

This reverts commit 5fdc9c73cf5f3c79071334a09476e0cb3b0903d2.
Revert "Revert "gcc 4.8 fixes""

This reverts commit 40d990c727494c947991102d7583388de2bf2e72.