adjust cleanup code slightly to take effect based on queue size at time of log message
shutdown server as last step
some fixes to specs to make them slightly more deterministic