Build fixes for newer ubuntu.

Part of #419.