Fix some bugs in snake