Patch over a buggy atan implementation