Added glitch correction logic to perturbation implementation. Some more useful/experimental functions for fixed-point numbers.