Fix, and add more, tests