Fixed isInvalidBone(b) so it doesn't always return true

isentity(b) always returned false. Replaced with type(b) ~= "PhysObj"