Have you tried adding the shapes first, then setting the collision flags?