avoid uninitialized value "estimated_time" (coverity 1135512)
check input data to avoid division by zero (coverity 1135498)
add test to verify if coverity 1047220 is a false positive