Avoid ClassCastException (Short and Integer in Web & Test environments)