[IMP] analyze: better compatibility with python 2 (print) + some bug prevention