Fixed an issue causing status history pruning to fail