Fix disgusting modulo issue