Fixed an infinite loop bug in _transmitBodyType()

When setting a body as static the "setAsStatic" method sometimes gets stuck in an infinite loop. This should fix the problem.