Fixes category linking and divide by zero errors