Fix ClassCastException from sending command from console