Fixed database locking horror.