Replace ambiguous abs() with fabs() so it compiles natively on OSX 10.9