Fixed bug with write statement code generation.