Fixed issue with MaxDistance value not being written.