Some changes, more unit tests