Atan2 improve

Some more improvements of the atan2 function.