Fixing bugs in Snake code.