Issue #9 solved. Writer is now closed properly.