Updated to work with GCC 4.x