Deep types convert properly with toJSON