Fix broken compilation under BSD-like systems
De-EvalContext-ify and de-Attribute-ize CheckMeasureSanity
Remove unused variable declaration