Added Serializable UIDs

Closed file buffers