Fix ClassCastException causing warning during deployment