Fix scheme and tests