Fix bad cast in 3a604563, and update pct to 64-bits to prevent truncation of intermediate value (pct * 100).