Fix bugs in last change.