Logic bug fix.