# Buggy code
def __init__(self, accountName, namePrefix, config=None, jobChunkSize=65535):
    self.jobChunkSize = jobChunkSize
    self.keyPath = None

    self.account_key = _fetchAzureAccountKey(accountName)

    # Table names have strict requirements in Azure
    self.namePrefix = self._sanitizeTableName(namePrefix)
    log.debug("Creating job store with name prefix '%s'" % self.namePrefix)

    # These are the main API entrypoints.
    self.tableService = TableService(
        account_key=self.account_key, account_name=accountName
    )
    self.blobService = BlobService(
        account_key=self.account_key, account_name=accountName
    )

    # Register our job-store in the global table for this storage account
    self.registryTable = self._getOrCreateTable("toilRegistry")
    exists = self.registryTable.get_entity(row_key=self.namePrefix)
    self._checkJobStoreCreation(
        config is not None, exists, accountName + ":" + self.namePrefix
    )
    self.registryTable.insert_or_replace_entity(
        row_key=self.namePrefix, entity={"exists": True}
    )

    # Serialized jobs table
    self.jobItems = self._getOrCreateTable(self.qualify("jobs"))
    # Job<->file mapping table
    self.jobFileIDs = self._getOrCreateTable(self.qualify("jobFileIDs"))

    # Container for all shared and unshared files
    self.files = self._getOrCreateBlobContainer(self.qualify("files"))

    # Stats and logging strings
    self.statsFiles = self._getOrCreateBlobContainer(self.qualify("statsfiles"))
    # File IDs that contain stats and logging strings
    self.statsFileIDs = self._getOrCreateTable(self.qualify("statsFileIDs"))

    super(AzureJobStore, self).__init__(config=config)

    if self.config.cseKey is not None:
        self.keyPath = self.config.cseKey


# Traceback (WindowsAzureError)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   Traceback (most recent call last):
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/toil/worker.py", line 282, in main
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       fileStore=fileStore)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/toil/job.py", line 1282, in _execute
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       self._serialiseJobGraph(jobWrapper, jobStore, returnValues, False)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/toil/job.py", line 1233, in _serialiseJobGraph
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       job._serialiseJob(jobStore, jobsToJobWrappers, jobWrapper)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/toil/job.py", line 1196, in _serialiseJob
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       jobStore.update(jobsToJobWrappers[self])
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/azureJobStore.py", line 150, in update
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       entity=job.toItem(chunkSize=self.jobChunkSize))
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/azureJobStore.py", line 517, in f
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       return function(**kwargs)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/azure/storage/tableservice.py", line 476, in update_entity
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       response = self._perform_request(request)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/azure/storage/storageclient.py", line 179, in _perform_request
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       _storage_error_handler(ex)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/azure/storage/__init__.py", line 1174, in _storage_error_handler
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       return _general_error_handler(http_error)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:     File "/usr/local/lib/python2.7/dist-packages/azure/__init__.py", line 551, in _general_error_handler
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:       http_error.respbody.decode('utf-8-sig'))
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   WindowsAzureError: Unknown error (Bad Request)
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   <?xml version="1.0" encoding="utf-8"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code>PropertyValueTooLarge</code><message xml:lang="en-US">The property value exceeds the maximum allowed size (64KB). If the property value is a string, it is UTF-16 encoded and the maximum number of characters should be 32K or less.
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   RequestId:bc75b149-0002-0131-4274-260c9f000000
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   Time:2015-11-24T04:54:04.2292362Z</message></error>
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   Exiting the worker because of a failed jobWrapper on host c1agent34
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   ERROR:toil.worker:Exiting the worker because of a failed jobWrapper on host c1agent34
WARNING:toil.leader:4f782575_20d9_48bb_bc1f_94cc8b207479:   WARNING:toil.jobWrapper:Due to failure we are reducing the remaining retry count of job 4f782575_20d9_48bb_bc1f_94cc8b207479 to 0

# Fixed code
def __init__(
    self, accountName, namePrefix, config=None, jobChunkSize=maxAzureTablePropertySize
):
    self.jobChunkSize = jobChunkSize
    self.keyPath = None

    self.account_key = _fetchAzureAccountKey(accountName)

    # Table names have strict requirements in Azure
    self.namePrefix = self._sanitizeTableName(namePrefix)
    log.debug("Creating job store with name prefix '%s'" % self.namePrefix)

    # These are the main API entrypoints.
    self.tableService = TableService(
        account_key=self.account_key, account_name=accountName
    )
    self.blobService = BlobService(
        account_key=self.account_key, account_name=accountName
    )

    # Register our job-store in the global table for this storage account
    self.registryTable = self._getOrCreateTable("toilRegistry")
    exists = self.registryTable.get_entity(row_key=self.namePrefix)
    self._checkJobStoreCreation(
        config is not None, exists, accountName + ":" + self.namePrefix
    )
    self.registryTable.insert_or_replace_entity(
        row_key=self.namePrefix, entity={"exists": True}
    )

    # Serialized jobs table
    self.jobItems = self._getOrCreateTable(self.qualify("jobs"))
    # Job<->file mapping table
    self.jobFileIDs = self._getOrCreateTable(self.qualify("jobFileIDs"))

    # Container for all shared and unshared files
    self.files = self._getOrCreateBlobContainer(self.qualify("files"))

    # Stats and logging strings
    self.statsFiles = self._getOrCreateBlobContainer(self.qualify("statsfiles"))
    # File IDs that contain stats and logging strings
    self.statsFileIDs = self._getOrCreateTable(self.qualify("statsFileIDs"))

    super(AzureJobStore, self).__init__(config=config)

    if self.config.cseKey is not None:
        self.keyPath = self.config.cseKey