Fixed a random UnsupportedOperationException getting thrown.