Fixed typo with write() function.