Remove unecessary casts

+ Check value in main fct