Fixed runtime error with compactify'DL on certain lists.

Closes #1452.  Added test.