fixes to some cordic functions