Fixed bug in defeat cache optimization