Update of the 'keep' command so that it now uses selector when available.