Fixing some inverted logic