Fixed a bug that was causing a ClassCastException.