utils.cpp: use stricter numeric conversions