Fix bug where I was deleting the shard reference before pulling out the shard to close it
Add test for max shards and fix bug in closing out old one