some patches and tests