Fixed a bug in the timing of QueueRecords handled by the BackgroundService class
Minor formatting updates and corrections