Stronger type checking for setAlarm() and squareWave() methods.