Solved register save/restore bug

This should do it!