Retested in CentOS 6.5, made code tweaks