Bug fix (division by 0)