Fix a bug with sorting PDV's.