Update playmode.py

Correct some bugs.