FIX: pimf & zmf now behave as expected

The input `x` required indexing.
Also fixed: minor math error and redundant calculations.
Merge pull request #2 from JDWarner/fix_zmf

FIX: pimf & zmf incorrect output fixed