Slight modification to support gcc 4.6