Fix scenario where `$time_to_wait` could inadvernently be set to zero