Everything works except for a pesky stackoverflow error when serializing a file.