Fix tests, ApplyResponse and associated classes