PWM frequency library

I have done the following program (as initial steps for a thermostat program)

#include <PWM.h>



int T;
int32_t frequency = 500; //initialize the pwm output at 100Hz

void setup(){
  InitTimersSafe();
  SetPinFrequencySafe(11, frequency);
}


void loop(){

T = analogRead(0);

pwmWrite(11, 50); // write the duty to the output

delay(2000);

}

Nothing happens, other than the output being full on. I can't use the standard PWM as it makes the fan (and powersupply transformer) hum. Mind you even the standard analogwrite has stopped working or does the library do that ?