Include math.h for log() (fix for OSX)