Fix deprecation and ambiguity warnings and test broken by MathConst

Fixes #277