Raycast problems in 2.1

Hi all!
I've got 2 problems with raycast.Need some help to solve it.
1.Ray pass through solid body, just like there is no body at all.
Image

2.Ray penetrate body through "the hole" between two shapes:
Image

p.s. as-code attached
http://code.google.com/p/box2d/issues/d ... &q=raycast
The latest C++ version allows you to return -1 to filter a shape.

Original thread: https://box2d.org/forum/viewtopic.php?t=4647