Unknown values (Xs) may exist in a design due to uninitialized registers or blocks that are powered down. Due to limitations known as X-optimism and X-pessimism, such Xs cannot be handled correctly in logic simulation, producing inaccurate simulation values that can mask X bugs or corrupt simulation results. This can cause X bugs to escape verification and reduces design quality. To resolve such X-related issues, we propose a comprehensive methodology and several novel methods to detect masked Xs at the register transfer level and eliminate false Xs at the gate level. Our case studies show that the proposed methods are both effective and efficient.