Added write() test for large data frame, some write() fixes.