fix some type errors, and make list extend do the right thing