Fix a bug with CAP support