Fixing generation of final result code.