fixed minor bugs in predict() method