for when the player is on the edge, the problem is the raycast only start from the middle point, so it doesn't hit the ground, you'll have to add another raycast from the edge of the bounding box of the player with direction also down to detect this, you can search tutorial regarding raycast for this issue.
As for your FSM not working, I'm not sure what causing it. I've set it once and it worked right away, so there is must be something wrong going on, can you check my tutorial again, see if you missed a step?