Fix logic for zeroing out caps