Fix the bugs in PySpark