@TheCycoONE: "Haven't tested this, but what happens if the west or north tile is not available now?"
I've fixed this issue by adding the west tile accessible check:
"and humanoid.world:isTileEmpty(humanoid.tile_x - 1, humanoid.tile_y, true)"