Add more test cases for writer