Fixes for gen, sur and ret, all the cases seem
to work now