Ported to Ubuntu 13.04 and gcc 4.7.