Fixed casting to int