Correct problem with regcode generation