Some fixes to have this version eventually used in MIPS