fixed double to int conversion warnings