FIX: pimf & zmf now behave as expected

The input `x` required indexing.
Also fixed: minor math error and redundant calculations.