Fix code from pull request #1 from jgartrel/master to work with Ubuntu 12.04 LTS