Fix build errors on CentOS 7 and Fedora 20