Fix more conversion problems, add more tests