Improvements/bug fixes to write.xlsx