Cleanup, partially to make it compile on Ubuntu 14.04