Prevent division by 0
Fix parameters name mixup