Add a test case for large write spliting and fix a bug