Improve this so it works on Ubuntu 14.04.
Merge pull request #507 from apenney/fix-1404

Improve this so it works on Ubuntu 14.04.