Made while condition shorter and more readable

The while condition in `off()` can be written simplified without `~`.