This patch corrects a coding error in the original implementation