FIX: pimf & zmf incorrect output fixed

The input `x` variable required indexing for correct output (gross errors before).
Also fixed: minor math error and redundant calculations in zmf.