Fixes #1.
Stronger type checking for setAlarm() and squareWave() methods.