Improved test_write_points