Function gen_regular_rel changed to handle negative numbers.