Added object writing as well.