Minor fixes, tested on CentOS 6.5