Problem with fixed objects

I'm trying to add a fixed object feature to the physics sandbox I'm making. It seems to work, but the collision shapes of the objects get messed up, so other objects will often fall straight through where the fixed object is supposed to be, and objects will hit an "invisible" fixed shape somewhere nearby on the screen. The selecting of objects (using testPoint) breaks as well, selecting the "ghost" shape rather than where the renderer is showing it if I click in the area where other objects are colliding with.

This is the code used to make an object fixed (this happens when a checkbox is clicked after an object is added to the world.

Code:
                if((Boolean) value == true)
                {
                    pMass = body.m_mass;
                    pInvMass = body.m_invMass;
                    body.m_invMass = 0;
                    body.m_mass = 0;
                }
                else
                {
                    body.m_mass = pMass;
                    body.m_invMass = pInvMass;
                }
Are these fixed objects the only ones with 'shadow' objects? Sounds like maybe the registration point for the shape isn't aligned with the registration point for whatever image you use on top of the shape.
Don't mess with private (m_) variables if you can help it. You should create fixed objects with the appropriate API, which is probably by calling SetMass or similar if you uare using 2.0.

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