Ah I see. Yes it was on 10x10, that must be why it was lagging so much. I probably don't need the grid to be that small, the smallest passages are 64 wide.
edit: Ok I changed the grid to 40x40 and it seems to have fixed the getting stuck problem. It's fixed the lag problem too, however when I go around the corner I sometimes get alot of lag. Is there no way at all to solve this?