Fix several warnings (casts, wrong string comparaison, ...)