I'm using your physics engine and it's great

I posted a movie on youTube of my game and of course credited you
(Search for "Oren Yona" on YouTube - it's the first 2 movies, they're the same)
I need some help with terrain collision.
My terrain is 513x513 size.
I'm creating a level editor and I used the terrain's physics entity to do Ray-casting for having some sort of a marker streached on the surface.
The problem is that it doesn't go smoothly... the raycasting returns Infinity a lot of times while it actually DOES suppose to collide.
Is there a better way to use your engine to use raycasting on a large terrain? (Maybe creating a triangle mesh entity instead of a terrain)
Is there any attribute I should change for it to work better? performance is less of an issue since this is just an editor...
Thanks in advanced!