Fixed some bugs on the snake

Still not fully checked