Fixes to make this work on Ubuntu 14.04.