Fixed ClassCastException. Closes #75