Fix inf loop for gen-dec-dec