Fix conversion of double -> int, as warned by g++ 4.1