Fix some build issues in Ubuntu 14.04