Fixed predict_n.py test and made some fixes to predict_n.py