3.6: improved CAP handling.