defensive programming

Fix some problems with python modules on CentOS.