Robust Functional Equations with Applications to Self-Testing/Correcting