Fix the Mod z remainder