Changing null check for consistency and slight perf gain.
Casting $secondsToWait to integer so it is not a fraction.
Get a fresh object count from the service.