Corrected error in sqrt function