Some changes and new tests