fix bugs in hypot