Fix fmax being undefined