Add remove_caps function #1032