apply patch from Fons for Ubuntu 12.04