Fix division by 0 issue in debug