Fix constant cache bug