tail and tests improvements