Fixing gzip problem in NBtrain.py, by doing some changes in it and in common.py as well