Misc changes to the python script

Fixed multiple errors/issues

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Merge branch 'tp/0927_fix' into ibm_next_2Xmerge_tmp
Merge branch 'tp/ibm_next_pystats' into ibm_next_2Xmerge_tmp