fix implicit double to int cast (caused warnings)