Fix silly error in square wave implementation.