Many changes and tests