Owing to the non-zero probability of the missed detection and false alarm of active primary transmission, a certain degree of performance degradation of the primary user (PU) from cognitive radio users (CRs) is unavoidable. In this paper, we consider OFDM-based communication systems and present efficient algorithms to maximize the total rate of the CR by optimizing jointly both the detection operation and the power allocation, taking into account the influence of the probabilities of missed detection and false alarm, namely, the sensing accuracy. The optimization problem can be formulated as a two-variable non-convex problem, which can be solved approximately by using an alternating direction optimization method. Our algorithm can operated basically in two regimes depending on our constraints that are involved, while keeping the performance degradation of the PU bounded properly. Simulation results demonstrate that the proposed solution can considerably improve system performance.