Fixed writer constructor