Fixed IllegalCastException.

(oops, forgot to update the source)