Added weight conversion. Disabled (undefined) debugging modes.