Fix case where cx = 0 gave undefined value