Fix divmod and remove old implementation