Fixed infinite loop in writing of object data.