Improves the save procedure of the local register mapping.

Works for me at least ;)
Maybe someone can do a quick check whether the handling regarding parameters is better.