Fix checkstyle
Prevent possible ClassCastException