Ported down to g++ 4.6