Fix corner case where input is zero.