Some changes and a couple of tests