fixed minor errors in Jeff's patches.